package xyz.zhzby.cyzx.acl.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import xyz.zhzby.cyzx.servicebase.domain.DataLogInfo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author zby
 * @since 2021-12-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("acl_permission")
@ApiModel(value="Permission对象", description="权限表")
public class Permission extends DataLogInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "父权限ID")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty(value = "名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "类型（1菜单,2按钮）")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "权限值")
    @TableField("value")
    private String value;

    @ApiModelProperty(value = "访问路径")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "组件路径")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "图标路径")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "状态（0禁止,1正常）")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "层级")
    @TableField(exist = false)
    private Integer level;

    @ApiModelProperty(value = "下级")
    @TableField(exist = false)
    private List<Permission> children;

    @ApiModelProperty(value = "是否选中")
    @TableField(exist = false)
    private boolean isSelect;

}
